﻿Public Class frmChkVN
    Dim mysql As New ClsSQLhelper
    Dim Strsql As String
    Private Sub BtnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSearch.Click
        Try
            If Me.TxtVN.Text.Trim = "" Then Exit Sub
            Strsql = "Select * from vn_stat where vn = '" & Me.TxtVN.Text.Trim & "'"
            Dim DT_VNSTAT As New DataTable
            DT_VNSTAT = mysql.GetMYSQLDataTable(Strsql, "vn_stat", True)
            With Me.DataGridView1
                .RowHeadersVisible = False
                .AllowDrop = False
                .AllowUserToAddRows = False
                .AllowUserToDeleteRows = False
                .AllowUserToOrderColumns = True
                .AllowUserToResizeColumns = True
                .AllowUserToResizeRows = False
                .MultiSelect = False
                .AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.DisplayedCells
                .AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells
                .DataSource = DT_VNSTAT 
            End With
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub
End Class